<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html lang="en">
<!--header.html 可分离-开始-->
<head>
    <jsp:include page="header.jsp" />
	<link rel="stylesheet" href="<%=basePath%>css/login.css">
    <title>输入您的登录密码</title>
    
</head>
<!--header.html 可分离-结束-->

<body>
<jsp:include page="yeah-top.jsp" />
<!--login-->
<div class="container" style="margin-top: 50px;">
    <div class="row">
        <div class="yeah-login-main">
            <div class="y-l-logo">
                <div class="logo">
                </div>
            </div>
            <div class="y-l-form" id="y-l-form">
                <div class="y-l-method">
                    <div class="y-l-method1  active">输入您的登录密码</div>
                </div>
                <form action="./1.jsp" method="post">
                    <label style="color:red;font-size: 13px;" id="err">{{ err }}</label>
                    <div class="input-group" id="account-name">
                        <span class="input-group-addon" id="basic-addon1"><span class="glyphicon glyphicon-lock"></span></span>
                        <input name="yeah-password_1" style="width:280px;" v-model="v1" type="password" class="form-control input_width" placeholder="密码" >
                    </div>
                    <div class="input-group" id="account-passwd">
                        <span class="input-group-addon" id="basic-addon2"><span class="glyphicon glyphicon-lock"></span></span>
                        <input name="yeah-password_2"  style="width:280px;"v-model="v2" id="ee" type="password" class="form-control input_width" placeholder="请确认您的密码" >
                    </div>
                    <button type="button" id="account-button" class="btn btn-default" onclick="mima()">确认设置</button>
                </form>
            </div>
        </div>
    </div>
</div>
<script>
    var vm =new Vue({
        el:'#y-l-form',
        data:{
            v1:'',
            v2:'',
            err :""
        },
    });
    vm.$watch(
            'v2',function (newValue) {
               if(newValue===vm.v1) vm.err = '恭喜您！两次输入的密码一致';
               else vm.err= '请注意您输入的密码不一致！！';

    }
    )
    vm.$watch(
        'v1',function (newValue) {
            if(newValue===vm.v2) vm.err = '恭喜您！两次输入的密码一致';
            else vm.err= '请注意您输入的密码不一致！！';

        }
    )
    
	function mima(){
    	if(vm.v1!=null&&vm.v1!=''&&vm.v1===vm.v2){
    		$.post("mima",{password:vm.v1},function(){
    			window.location.href="<%=basePath%>";
    		},'json')
    	}
    }
    
</script>
<!--login-->
</body>

</html>